include(cc_library)

cc_library(
  NAME
    common_layers
  HDRS
    flashinfer_workspace.h
    deepseek_v2_attention.h
    qwen2_attention.h
    attention.h
    fuse_norm.h
    rotary_embedding.h
    fused_moe.h
    dense_mlp.h
    qwen2_decoder_layer.h
    qwen3_moe_decoder_layer.h
    linear.h
    word_embedding_impl.h
    layer_utils.h
    indexer.h
    deepseek_v2_attention.h
    deepseek_v2_decoder_layer.h
  SRCS
    flashinfer_workspace.cpp
    deepseek_v2_attention.cpp
    qwen2_attention.cpp
    attention.cpp
    fuse_norm.cpp
    rotary_embedding.cpp
    fused_moe.cpp
    dense_mlp.cpp
    qwen2_decoder_layer.cpp
    qwen3_moe_decoder_layer.cpp
    linear.cpp
    word_embedding_impl.cpp
    layer_utils.cpp
    indexer.cpp
    deepseek_v2_attention.cpp
    deepseek_v2_decoder_layer.cpp
  DEPS
    "-Wl,--whole-archive"
    "-Wl,--no-whole-archive"
    :kv_cache
    :prefix_cache
    :block
    :parallel_state
    :state_dict
    :model
    :kernels
    glog::glog
    gflags::gflags
    torch
    :platform
)

add_subdirectory(tests)
